import 'package:flutter_test/flutter_test.dart';
import 'package:app_links_ohos/app_links_ohos.dart';
import 'package:app_links_ohos/app_links_ohos_platform_interface.dart';
import 'package:app_links_ohos/app_links_ohos_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockAppLinksOhosPlatform
    with MockPlatformInterfaceMixin
    implements AppLinksOhosPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final AppLinksOhosPlatform initialPlatform = AppLinksOhosPlatform.instance;

  test('$MethodChannelAppLinksOhos is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelAppLinksOhos>());
  });

  test('getPlatformVersion', () async {
    AppLinksOhos appLinksOhosPlugin = AppLinksOhos();
    MockAppLinksOhosPlatform fakePlatform = MockAppLinksOhosPlatform();
    AppLinksOhosPlatform.instance = fakePlatform;

    expect(await appLinksOhosPlugin.getPlatformVersion(), '42');
  });
}
